package com.leetcode.LC;

public class LC206 {
    public ListNode reverseList(ListNode head) {
        //https://www.bilibili.com/video/BV1wA411b7qZ?p=34
        ListNode prev = null;
        ListNode curr = head;
        ListNode next = null;

        while (curr!=null){
            next=curr.next;
            curr.next=prev;
            prev=curr;
            curr=next;
        }
        return prev;
    }
}